Get Hour and minute in SQL

Get Hour and minute in SQL

SELECT  
CASE 
WHEN DATEDIFF(MINUTE,'2020-12-18 10:52:12',GETDATE())/60>0 
THEN DATEDIFF(MINUTE,'2020-12-18 10:52:12',GETDATE())/60 
ELSE '' 
END Hr, 
DATEDIFF(MINUTE,'2020-12-18 10:52:12',GETDATE())%60 min ;

Output


Login for comment